﻿using Hhmocon.Mes.Repository.Domain;
using Hhmocon.Mes.Repository.Repository;
using Hhmocon.Mes.Repository.Repository.Base;
using Hhmocon.Mes.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hhmocon.Mes.Application.Base
{
    public class RoboticEquipmentApp
    {
        private IRoboticEquipmentRepository _roboticEquipmentRepository;
        private PikachuRepository _pikachuRepository;
        public RoboticEquipmentApp(IRoboticEquipmentRepository roboticEquipmentRepository, PikachuRepository pikachuRepository)
        {
            _roboticEquipmentRepository = roboticEquipmentRepository;
            _pikachuRepository = pikachuRepository;
        }

        public robotic_equipment Insert(robotic_equipment data)
        {
            //取ID
            //data.sys_equipment_id = CommonHelper.GetNextGUID();
            data.modified_time = Time.Now;
            data.create_time = DateTime.Now;
            if (_pikachuRepository.Insert(data))
            {
                return data;
            }
            else
            {
                return null;
            }
        }
    }
}
